import Vue from 'vue'
import Vuex from 'vuex'
import banner from "@/store/modules/banner";
// import detail from "@/store/modules/detail";
import topList from "@/store/modules/topList";
import songList from "@/store/modules/songList";
import hotRecommend from "@/store/modules/hotRecommend";
import playList from "@/store/modules/playList";
import topSongList from "@/store/modules/topSongList";
import commentList from "@/store/modules/commentList";
import albumList from "@/store/modules/albumList";
import songDetailList from "@/store/modules/songDetailList";
import userDetail from "@/store/modules/userDetail";
import track from "@/store/modules/track";
import createPersistedState from "vuex-persistedstate";
import setting from "@/store/modules/setting";
import userInfo from "@/store/modules/userInfo";
Vue.use(Vuex)

export default new Vuex.Store({
    state: {},
    getters: {},
    mutations: {},
    actions: {},
    modules: {
        // detail,
        banner,
        topList,
        songList,
        hotRecommend,
        songDetailList,
        playList,
        topSongList,
        commentList,
        albumList,
        userDetail,
        track,
        setting,
        userInfo,
    },
    plugins: [createPersistedState({//带参数的写法
        key:"song",
        storage: window.localStorage,//要存的地方，如果不配置，默认是localStorage
        paths: ['track']//要存的数据模块，如果不配置，就是所有模块的数据都保存
    }),createPersistedState({//带参数的写法
        key:"player-setting",
        storage: window.localStorage,//要存的地方，如果不配置，默认是localStorage
        paths: ['setting']//要存的数据模块，如果不配置，就是所有模块的数据都保存
    }),]
})
